Application of LSTM algorithm combined with Kalman filter and SOGI in phase-locked technology of aviation variable frequency power supply

With the development of computer technology, the concept of computer automatic control has gradually penetrated the research field of aircraft power control, and intelligent power control systems have become mainstream research. The present work aims to improve the performance of the broadband phase-locked loop (PLL) based on the linear Kalman filter. Specifically, this paper first introduces linear Kalman filter and second-order generalized integrator (SOGI). Then, SOGI is added to PLL based on the linear Kalman filter. The pur-pose is to use the infinite gain effect of SOGI at the central angular frequency to eliminate the time-varying angular frequency component in the error when the system inputs SOGI to achieve a better filtering effect. Then, the system’s stability analysis and parameter settings are carried out to establish an intelligent phase-locked method of aviation variable frequency power supply. Finally, simulation experiments are performed. The experimental results demonstrate that PLL via the linear Kalman filter with SOGI can solve the problem that the output phase angle contains high-frequency components when the power supply voltage distortion rate is 10%. This scheme has a strong anti-interference ability under power grid voltage imbalance. The accuracy of the Long and Short-term Memory network used here is about 80%, which can well realize the intelligent aviation power frequency conversion control method. The research reported here provides a reference for establishing smart phase-locked technology of aviation variable frequency power supply.


Introduction
As the multi-electric aircraft technology constantly advances, the aircraft power system capacity increases, realizing higher power generation efficiency. The advantages of aviation variable frequency power supply without constant installation and converter are gradually emerging [1][2][3]. The three-phase rectifier is a critical power conversion link in airborne electrical equipment. The high-power factor is one of the fundamental indexes to measure the performance of rectifiers for aviation applications. It is necessary to obtain grid voltage phase information to achieve high power factor operation of the rectifier, which is usually completed by a phaselocked loop (PLL). The wide operating frequency range (typically 360-800Hz) of aviation variable frequency power supply and the characteristics of small capacity grid voltage easily affected by load distortion put forward higher requirements for phase-locked technology on this occasion. The requirements for the phase-locked technology of high-power factor rectifier power supply of the system are increasing due to the particularity of the frequency range of aviation variable frequency power supply and the problem that the load easily distorts the power supply voltage. Many pieces of literature have studied the phase-locked technology of aviation variable frequency power supply with a wide working frequency range and less harmonic content. A second-order generalized integrator (SOGI) is added in the front stage of PLL to realize accurate phase locking in the environment of the high harmonic range of power supply voltage and unbalanced three-phase grid voltage. SOGI is a typical second-order filter that simultaneously generates two mutually orthogonal signals. Besides, its transfer function has infinite gain in a specific frequency. Reference [4] proposes a PLL based on the discrete Fourier transform (DFT) algorithm for aviation variable frequency power supply systems. Its principle is to separate the fundamental component of the power supply by using the DFT algorithm and then use Proportional Integral Controller as a loop filter. Finally, a PLL is completed by corresponding calculation. However, the dynamic response is slow due to the algorithm's complexity, and the phase information cannot be obtained quickly. A PLL of Steady-state linear Kalman filter (SSLKF) is put forward in references [5,6], an adaptive phase-frequency estimation algorithm based on a third-order linear constant observation model and a predictive correction model. Three different control units are used to estimate phase angle, angular frequency, and angular frequency acceleration, respectively, with high phase-locked accuracy, fast dynamic response, and other advantages. In reference [7], two PLLs are comprehensively compared in dynamic performance, phase-locked accuracy, and filtering effect. It is concluded that the linear Kalman filter PLL has more advantages. Therefore, the linear Kalman filter PLL is more suitable for the phase-locked system of aviation variable frequency power supply. However, the phase-locked technology of aviation variable frequency power supply with high harmonic content has not been studied in the existing literature. According to the DO-160G standard, the maximum single voltage distortion rate of aviation variable frequency power supply is 8%, and the maximum total voltage distortion rate is 10%. The linear Kalman filter PLL is applied to the environment with a low power supply voltage distortion rate. Although good phaselocked results are obtained, when the distortion rate of aviation variable frequency power supply reaches 10%, the output phase angle of linear Kalman filter PLL contains high-frequency components, which affects the overall performance of the converter. In references [8][9][10][11], the convergence of differential equations solutions is used to judge the system's stability, which concerns the analysis of high-order nonlinear systems. Inspired by the method proposed in reference [12], this paper presents the structure of linear Kalman filter PLL with SOGI. Most of the PLLs in the existing literature are applied to the linear analysis of the small-signal model. There is a significant deviation from the linear model of small signals for nonlinear systems under the condition of large-signal input [13][14][15]. Therefore, it is necessary to carry out a nonlinear analysis of PLLs. The existing literature seldom investigates high-order nonlinear systems and intelligent power control systems.
A SOGI is introduced into the PLL based on the linear Kalman filter to establish an intelligent aviation variable frequency power supply control system. The central angular frequency of the SOGI is obtained by the PLL feedback of the linear Kalman filter. Because the SOGI has infinite gain at its central angular frequency, it has a good filtering effect. The central angular frequency is a variable with time, constituting a high-order PLL system with strong nonlinearity. Then, the state equation of the system is derived and solved to obtain the stability region. The filter is optimized using the Long and Short-term Memory (LSTM) network to improve the intelligence of the design method. Finally, the effectiveness of the PLL based on the linear Kalman filter with SOGI is verified by simulation and experiment. The research presented here is mainly divided into three parts. Section 1 introduces the research theories and methods and leads to the problems to be solved. Section 2 designs the technique to improve the system's stability and optimizes the parameters of the model to enhance the algorithm's effectiveness. Section 3 tests this method to verify this method's effectiveness in dealing with the related problems.

PLL structure of linear Kalman filter with SOGI
Due to the high harmonic content of aviation variable frequency power supply, the phase angle output by PLL contains high-frequency components. Thus, it is impossible to obtain the phase information of power supply voltage accurately. Especially for the grid-connected device based on a power electronic converter, synchronizing with the grid voltage is essential for regular operation. If the rectifier cannot accurately obtain the phase information of grid voltage, the power factor cannot be corrected, resulting in the injection of reactive power into the grid. Therefore, it is necessary to accurately obtain the phase information of power supply voltage under non-ideal conditions such as the long harmonic content of aviation variable frequency power supply. The fundamental frequency of aviation variable frequency power supply changes linearly, ranging 360Hz-800Hz. Consequently, the high-order harmonic frequency changes at a higher rate, increasing the difficulty of filter design. Therefore, designing an appropriate filter combined with PLL is essential to solve the phase-locked problem when there are many harmonics in the aviation variable frequency power supply.
The aviation power distribution technology gradually develops from manual centralized control to computer control and turns to the intelligent control field [16]. The research on the control of aviation variable frequency power supply is a vital basis to ensure the safety of aviation power systems. This paper uses the linear Kalman filter as the PLL filter. Besides, good filtering results are achieved with the help of the wireless gain effect of the SOGI. The central angular frequency of the SOGI is returned by the output angular frequency ω g of the Kalman filter PLL. Fig 1 displays the PLL structure. The stability of the working frequency is ensured by polyphase control of the input current. The structure of Kalman filter PLL is given in reference [13], as shown in

PLL structure based on the linear Kalman filter optimized by the neural network
PLL is a device used to generate clock signals, which needs incredibly high performance. In the process of oscillation control, the equipment is required to have a high-frequency coverage to avoid the influence of loop instability and phase noise on the equipment. The structure of the LSTM network is obtained after optimization based on a cyclic neural network. Each neuron in the network has a set of independent parameters. However, there is a connection relationship between neurons, which can preserve the potential relationship in the data for a long time and positively affect processing time series problems [17]. Therefore, the LSTM network is suitable for processing important events with relatively long intervals and delays in time series.
Here, the LSTM network is employed to optimize the Kalman filter PLL. According to Fig  2, the time-domain equation between the phase angle θ g and angular frequency ω g output by the Kalman filter PLL, and the three-phase grid voltage v a , v b and v c after synchronous coordinate transformation can be expressed by Eq (1).
In Eq (1), k 1 , k 2 , and k 3 are coefficients, and T s represents the sampling period. Fig 3 illustrates the structure of the neural network. The neural network includes three layers: the input layer, hidden layer, and output layer, through which the data is input and processed. The linear Kalman filter PLL based on LSTM is multi-configuration. The interior neural network module takes the input signal as training and outputs the digital signal of control voltage to control the voltage passing through PLL.

Structure of SOGI
SOGI is a second-order integrator and an integral part of the controller. However, SOGI is easy to oscillate and has poor stability at the characteristic frequency point. Hence, SOGI with damping is used instead, which has the characteristics of frequency selection and low-pass filtering to suppress harmonics and achieve synchronization and orthogonal with the input signal. Fig 4 shows the structure of SOGI, where the center angular frequency is obtained by the output angular frequency ω g of Kalman filter PLL. The time-domain equation of SOGI is expressed by Eq (2).
In Eq (2), k denotes the damping coefficient of SOGI, v'stands for the grid voltage, and ω`refers to the angular frequency.

System stability analysis and parameter design
According to Fig 1, the real-time angular frequency output by the system is fed back to SOGI. Because the frequency of aviation variable frequency power supply changes in real time, the whole system constitutes a high-order nonlinear structure [18].
Since Vα and v β are linear transformation of three-phase input voltage v a , v b , and v c , they can be regarded as the input of the system. According to Fig 1 and Eq (2), there are: According to the transformation formula from αβ axis to dq axis, the relationship between the system output phase angle and each quantity can be presented as Eq (7).
Therefore, from Eq (1) and Eqs (3)~ (7), the time domain equation of the whole system can be expressed as Eq (8).
Then, state variables are selected as follows: Eq (8) is transformed into an equation of state as shown in Eq (10).
8 > > > > > > > > > > > > > > < > > > > > > > > > > > > > > : According to Eq (10), this system is a seventh order nonlinear system, and the stability of the system is determined by parameters k, k 1 , k 2 , k 3 , and T s . Therefore, the values of k 1 , k 2 , k 3 , and T s are first determined to select the bandwidth of Kalman filter PLL, and then, the value of k is decided to ensure the stability of the system [19]. Fig 5 illustrates the small signal model [13] of linear Kalman filter PLL. Then, the closedloop transfer function of the linear Kalman filter PLL can be written as Eq (11).
To ensure the stability of the PLL system of linear Kalman filter, the root of the characteristic equation of its closed-loop transfer function is set as a negative real root and a pair of negative real part conjugate roots, as shown in Eq (12).
In Eq (12), w n >0, R>0, and 0 < � < p 2 . Substituting Eq (12) into the characteristic equation, there is: Substituting Eq (13) into Eq (11), Eq (11) can be expressed as: The bandwidth f b of PLL of linear Kalman filter is determined by parameters R, w n , and ϕ. According to the definition of bandwidth, G represents the bandwidth. Then, there is: Then, the relationship between bandwidth and various parameters is: ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi Through reference [7], the change of parameter w n has a great impact on the bandwidth. Therefore, let R = 1, and ϕ = π/3, and f b is determined by the parameter w n . The bandwidth is set as 100Hz, 200Hz, and 300Hz, respectively, and the values of parameter w n are summarized in Table 1 [20].
Firstly, the bandwidth of PLL based on linear Kalman filter is selected. Then, the filtering performance and dynamic performance of the PLL based on linear Kalman filter under three different bandwidths are compared after adding a SOGI.
Eq (17) represents A phase voltage in the three-phase balanced power grid system. v a ¼ 115 The fundamental wave frequency is set to 400Hz, the fundamental voltage of v a is expressed as v afund , and the effective value is 115V. Besides, the total voltage distortion rate is 10.8%, the maximum single voltage distortion rate is 9.2%, and the parameter of SOGI is 1. The simulation results of linear Kalman filter under the above three bandwidths are compared.
As shown in Fig 6, the angular frequency ω g output by PLL can reach the steady-state value of 800πrad/s under three bandwidths. Moreover, the dynamic response of the bandwidth at 300Hz is better, but the oscillation time is longer before entering a steady state. The bandwidth has the slowest dynamic response at 100Hz.   Considering both the dynamic response and filtering effect of PLL, PLL has the best effect when the bandwidth of PLL based on linear Kalman filter is 200Hz.
The PLL bandwidth of linear Kalman filter is set to 200Hz, so the corresponding parameters are R = 1, ϕ = π/3, and w n = 738.955. (a) f b = 100Hz According to Eq (13), k 1 = 738.955 3 , k 2 = 1,092,108.98,405, and k 3 = 1,477.91. In reference [12], the solution of differential equations is used to judge the stability of the system. Since the stability of the system is independent of the input, let v α = 1V, v β = 1V, and the sampling period T s = 0.000,125s. In addition, the ode23tb function of MATLAB is utilized to solve the solution of differential equations. Fig 8 provides the solutions of the differential equations when the parameter k of SOGI takes different values. From Fig 8, when k = 0.5, k = 1, k = 2, k = 3, and k = 5, x 1~x6 converge with the change of time, while x 7 is divergent. However, x 7 = θ g is the quantity varying with time, and x 5 = 0. Therefore, v q is a bounded quantity and an error quantity, so the system is stable. Since the stability region of the system is a sufficient condition for the stability of the system, a conservative stability region can be selected, and k is stable in [0.5, 3].

Simulation and experimental verification
It is concluded in the previous section that the system parameters k 1 = 738.955 3 , k 2 = 1,092,108.98405, k 3 = 1,477.91, T s = 0.000,125s, and k is stable in the range of [0. 5,3]. Then, Simulink is for simulation.
In the three-phase balanced power grid system, the A phase voltage is represented by Eq (17), the fundamental wave frequency is 360 Hz~800 Hz, and the change rate is a linear change of 200 Hz/s according to the DO-160G standard. Fig 9 illustrates the simulation waveform of angular frequency ω g and phase angle θ g when k = 0.5, k = 1, k = 2, k = 3, and k = 5, respectively.
(1) ω g From the above waveforms, when k = 0.5, k = 1, k = 2, k = 3, and k = 5, the angular frequency ω g output by PLL finally changes linearly with the change rate of 400πrad/s 2 , and the output phase angle θ g also reaches a stable state. Therefore, k is proved to be stable within [0. 5,3]. Through Fig 8, when k is in the range of [0. 5,3], the output phase angle linearity is good, and the angular frequency is stable. Therefore, k in the range of [0. 1,3] can meet the phaselock requirements.
Then, the output phase angle θ g of the PLL based on Kalman filter with SOGI is compared with that of the PLL based on Kalman filter without SOGI under the same input power supply. Furthermore, the anti-interference energy of PLL is verified when the grid voltage is unbalanced. In this test, k = 1, the power supply voltage is shown as Eq (17), the fundamental frequency is 360 Hz~800, and the linear change rate is 200 Hz/s. Besides, the fundamental voltage of C phase suddenly changes to 0 at 0.1s. Then, cosθ g output by PLL after 100 times expansion is compared with v afund . Fig 11 illustrates the simulation results under the condition of power grid voltage imbalance.
It can be seen from Fig 11 that after the fundamental voltage of C phase suddenly changes to 0, the phase-lock accuracy is restored for about one cycle. This result proves that it has good anti-interference ability.
Neural networks with different amounts of layers are compared to verify the effect of the neural network on phase-lock. Fig 12 shows the comparison results of convolutional neural network (CNN) and LSTM network.
As can be seen from the results in Fig 12, the accuracy of the CNN algorithm is 75% at the highest and 70% at the lowest. The highest accuracy of the LSTM algorithm is 80%, and the lowest is 75.5%. Therefore, with different hidden layers, the LSTM network has better performance than CNN, and the highest accuracy can reach about 80%. Compared with similar research, the method designed here realizes the intelligent aviation power frequency conversion control method, with specific practical value.

Discussion
The PLL based on linear Kalman filter is combined SOGI with to establish the intelligent phase-locked technology of aviation variable frequency power supply. For the high-order phase-locked loop system with strong nonlinearity, the state equations of the whole phaselocked loop are derived and solved to obtain a stable region of the system. The filter is optimized based on the LSTM network. The results show that in the three-phase balanced power grid system, k ranging [0. 1,3] can meet the phase-locked requirement. The output phase angle linearity of Kalman filter PLL with SOGI is obviously better than that under the above same input power supply, and the high-frequency component in the phase angle is filtered out. The experimental results indicate that the addition of LSTM network can realize the intelligent aviation power frequency conversion control. Therefore, this paper can achieve the accurate phase-locked of aviation variable frequency power supply.

Conclusion
The PLL based on linear Kalman filter and SOGI can adapt to wide input frequency and has the advantages of high phase-locked accuracy and fast dynamic response. Still, its phase-locked accuracy is affected by power supply voltage distortion. This method is simulated and verified in the stability region by designing the experiment. It is proved that the linear Kalman filter PLL with SOGI can solve the problem that the output phase angle contains high-frequency components when the distortion rate is 10%. The accuracy of the optimized model is more PLOS ONE than 80%. Therefore, this PLL method has a strong anti-interference ability under the condition of power grid voltage imbalance, which is conducive to the realization of accurate phaselocked. Compared with similar studies, the method proposed here can control the aviation variable frequency power supply more intelligently and effectively improve the power supply stability of the aviation power supply system. This paper provides a reference for the application of related technologies. However, there are some deficiencies in the current research. For example, the neural network excessively depends on data sets, but there are few types of data set labels, which cannot well simulate the situation in the actual environment. Moreover, the practical application effect of the designed method also needs to be further optimized. Therefore, the follow-up research will further explore the designed algorithm and its practical application.